import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os

path = r'D:\Code\Python_code\python_learning\py_stage_3'
file_name = '附录一：30支股票行情.csv'

if __name__ == '__main__':
    df = pd.read_csv(os.path.join(path, file_name))
    print(df[['time']].shape)
    # df = df[df['code'] == 'szse.000069'].drop(['code', 'open_interest'], axis=1)
    # df.drop(columns=['Unnamed: 0'], inplace=True)
    # df = df.reset_index(drop=True)
    # temp = df.drop(['time'], axis=1)
    # for col in temp.columns:
    #     mmax = temp[col].max()
    #     mmin = temp[col].min()
    #     df[col] = (temp[col]-mmin)/(mmax-mmin)
    # df['time'] = df['time'].apply(lambda x: x[:10])
    # plt.plot(df['time'].tolist(), df['volume'].tolist())
    # # plt.plot(df['time'].tolist(), df['amount'].tolist())
    # plt.xticks(np.arange(0, len(df), 100), [df['time'][i] for i in range(0, len(df), 100)], rotation=45)
    # plt.show()

